package com.fzu.messageservice.client;

import com.fzu.commonutil.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 调用normal-service的服务
 *
 * @author zyq
 */
@FeignClient(name = "normal-service", url = "http://127.0.0.1:18083")
public interface NormalClient {

    /**
     * 解密令牌获取用户信息
     *
     * @param token
     * @return
     */
    @GetMapping("/api/user/decode")
    String decode(@RequestParam String token);

    @GetMapping("/api/user/getAllUser/{id}")
    List<User> getAllUser(@PathVariable String id);

    @GetMapping("/api/user/getUser/{id}")
    User getUserById(@PathVariable String id);
}
